﻿using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace KxApp.Components
{
    public class CornerRadiusConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            // 处理空值情况，返回默认的 CornerRadius 值
            if (value == null)
            {
                return new CornerRadius(0);
            }

            return value;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotSupportedException();
        }
    }
}
